function showAlert (msg) {
	$('#AlertDiv').html(msg).show().delay(10).hide();
}

function SendForm (did) {
	$('#Progress').show();
	
	var txt = $('#Form_Text').val();
	var usr = $('#UserName').val();
	
		$.post(siteUrl+"newreply",
			{discussion_id: did, text: txt, user: usr},
			function (data) {
				if(data.status == 'ok') {
					$('#Form_Text').text('');
					$('#Replys').append(data.text);
					$('#Reply_' + data.id).slideDown('slow');
					$('#Reply_' + data.id).effect("highlight", {}, 1000);
					$('#Progress').hide();
				} else if(data.status == 'fuck') {
					alert(data.msg);
					$('#Progress').hide();
				}
				return data;
			}
		,"json");
}

